//
//  MainUITabBarController.m
//  GuoMei
//
//  Created by 王磊 on 2018/2/27.
//  Copyright © 2018年 王磊. All rights reserved.
//

#import "MainUITabBarController.h"
#import "MationViewController.h"
#import "MallViewController.h"
#import "MeViewController.h"
#import "MediaListViewController.h"
#import "BeautyShopViewController.h"
#import "MainNavigationViewController.h"
@interface MainUITabBarController ()

@end

@implementation MainUITabBarController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    
    [self addChildVC:[[MationViewController alloc]init] title:@"美信" image:@"tabr_01_up" selectImage:@"tabr_01_down"];
    
    [self addChildVC:[[MallViewController alloc]init] title:@"商城" image:@"tabr_02_up" selectImage:@"tabr_02_down"];
    
    [self addChildVC:[[MediaListViewController alloc]init] title:@"美媒榜" image:@"tabr_03_up" selectImage:@"tabr_03_down"];
    
    [self addChildVC:[[BeautyShopViewController alloc]init] title:@"美店" image:@"tabr_04_up" selectImage:@"tabr_04_down"];
    
    [self addChildVC:[[MeViewController alloc]init] title:@"我的" image:@"tabr_05_up" selectImage:@"tabr_05_down"];
    
    
}
-(void)addChildVC:(UIViewController *)childVC  title:(NSString *)title image:(NSString *)image selectImage:(NSString *)selectImage{
    childVC.tabBarItem.image = [UIImage imageNamed:image];
    childVC.tabBarItem.selectedImage = [UIImage imageNamed:selectImage];
    childVC.tabBarItem.imageInsets=UIEdgeInsetsMake(6, 0,-6, 0);
    MainNavigationViewController * nav = [[MainNavigationViewController alloc]initWithRootViewController:childVC];
    [self addChildViewController:nav];
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
